@extends('layouts.admin')

@section('title', '添加产品')

@section('content')
    <div class="container">
        {!! Form::model($product, array('route' => 'admin.product.update', 'files'=> true, 'method' => 'PUT')) !!}
        <div class="form-group">
            {!! Form::text('title',$product->title,['class'=>'form-control', 'placeholder' => 'What is your title?']) !!}
        </div>
        <div class="form-group">
            {!! Form::label('image', 'Your Image') !!}
            {!! Form::file('image') !!}
            <p class="help-block">产品图片。Hey! Please don't upload over 15MB images!</p>
                <img class="img-responsive" src="{{ asset($category->image_url) }}" />
        </div>
        <div class="form-group">
            {!! Form::label('category_id', '产品分类') !!}
            {!! Form::select('category_id', $categories, $product->category_id,['class'=>'form-control', 'placeholder' => 'Your caption', 'required' => '']); !!}
            <p class="help-block">Hey! Please don't upload over 15MB images!</p>
        </div>
        <div class="form-group">
            {!! Form::label('description', 'Don\'t miss to caption!') !!}
            {!! Form::text('description',$product->description,['class'=>'form-control', 'placeholder' => 'Your caption']) !!}
        </div>
        {!! Form::submit('更新',['class'=>'btn btn-info']) !!}
        {!!Form::close() !!}
    </div>
@stop